package designPattern.behavioralPattern.state;

/**
 * @author wei.zhao
 * @description:
 * @date 2021年12月22日 10:46
 */
public class Context {

    private State state;

    public Context(State state) {
        this.state = state;
    }

    public State getState() {
        return state;
    }

    public void setState(State state) {
        this.state = state;
        System.out.println("当前状态是：" + state.getClass().getSimpleName());
    }

    public void request() {
        state.handle(this);
    }

}
